// logs.js
// pages/categories/index.js
Page({
  data: {
    categories: [
      {
        key: 'anxiety',
        title: '字母学习',
        books: [
          { id: 'book1', title: '第一个吻', cover: '/images/coloring.png' },
          { id: 'book2', title: '我不想离开你', cover: '/images/copy_right.png' },
          { id: 'book3', title: '魔法亲亲', cover: '/images/tracing.png' },
          // 更多可添加
        ]
      },
      {
        key: 'fathersday',
        title: '拼读规则',
        books: [
          { id: 'book4', title: '国王爸爸', cover: '/images/coloring.png' },
          { id: 'book5', title: '我爸爸', cover: '/images/copy_right.png' },
          { id: 'book6', title: '爸爸带我看宇宙', cover: '/images/tracing.png' }
        ]
      },
      {
        key: 'fathersday',
        title: '绘本阅读',
        books: [
          { id: 'book4', title: '国王爸爸', cover: '/images/coloring.png' },
          { id: 'book5', title: '我爸爸', cover: '/images/copy_right.png' },
          { id: 'book6', title: '爸爸带我看宇宙', cover: '/images/tracing.png' }
        ]
      },
      {
        key: 'fathersday',
        title: '启蒙动画片',
        books: [
          { id: 'book4', title: '国王爸爸', cover: '/images/coloring.png' },
          { id: 'book5', title: '我爸爸', cover: '/images/copy_right.png' },
          { id: 'book6', title: '爸爸带我看宇宙', cover: '/images/tracing.png' }
        ]
      }
    ]
  },

  goToDetail(e) {
    const id = e.currentTarget.dataset.id;
    wx.navigateTo({
      url: `/pages/detail/index?id=${id}`
    });
  },

  viewMore(e) {
    const category = e.currentTarget.dataset.category;
    wx.navigateTo({
      url: `/pages/resources/index?category=${category}`
    });
  }
});

